Remove unnecessary root re-exports #19742
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue:
These files were a bit of a crutch in the days before package.json
exports
maps.What I did
I'm opening this PR as a bit of an experiment to see if CI will pass.
We are currently using
moduleResolution: node
in our typescript project, which I recently learned means "node11" (the TS team is planning to rename it). Node 11 does not support package.jsonexports
. In order to support it, we could change our moduleResolution to "Node16" or "nodenext", but that also implies the use of ESM, and we're not writing code that's used directly in node, but rather is being bundled using esbuild (via tsup). There is not currently a module resolution in typescript for bundlers (see microsoft/TypeScript#50152 for a great description of the current problems).This also adds a
typesVersions
field to a package.json in order to get tsup to build correctly. This is one of the options for compatibility laid out in https://github.com/andrewbranch/example-subpath-exports-ts-compat. It does not support bundling with parcel or browserify, but I think we don't need to worry about that, since we support webpack and vite, and use esbuild internally.How to test